package com.zb;

import com.zb.util.CanalSearchUtil;
import com.zb.util.CanalUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableDiscoveryClient
public class CanalApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(CanalApplication.class);
        CanalUtil bean = run.getBean(CanalUtil.class);
//        bean.main();
        CanalSearchUtil searchUtil = run.getBean(CanalSearchUtil.class);
        searchUtil.main();
    }

//    @LoadBalanced
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
